package com.anjbo.bean.estatedeal;

import com.anjbo.common.DateUtil;

import java.util.List;

/**
 * Created by Administrator on 2017/3/14.
 */
public class DGDealWrapperDto {

    /*东莞一手数据*/
    private List<DGDealDto> oneData;
    /*东莞一手详情*/
    private List<DGDealDto> oneDetail;
    /*东莞二手数据*/
    private List<DGDealDto> scndData;
    /*东莞二手详情*/
    private List<DGDealDto> scndDetail;

    public List<DGDealDto> getOneData() {
        return oneData;
    }

    public void setOneData(List<DGDealDto> oneData) {
        this.oneData = oneData;
    }

    public List<DGDealDto> getOneDetail() {
        return oneDetail;
    }

    public void setOneDetail(List<DGDealDto> oneDetail) {
        this.oneDetail = oneDetail;
    }

    public List<DGDealDto> getScndData() {
        return scndData;
    }

    public void setScndData(List<DGDealDto> scndData) {
        this.scndData = scndData;
    }

    public List<DGDealDto> getScndDetail() {
        return scndDetail;
    }

    public void setScndDetail(List<DGDealDto> scndDetail) {
        this.scndDetail = scndDetail;
    }

    public DGDealWrapperDto() {
    }

    public DGDealWrapperDto(List<DGDealDto> oneData, List<DGDealDto> oneDetail, List<DGDealDto> scndData, List<DGDealDto> scndDetail) {
        this.oneData = oneData;
        this.oneDetail = oneDetail;
        this.scndData = scndData;
        this.scndDetail = scndDetail;
        init();
    }

    private void init(){
        toDateStr(oneData);
        toDateStr(oneDetail);
        toDateStr(scndData);
        toDateStr(scndDetail);
    }

    public void toDateStr(List<DGDealDto> list){
        if(list!=null){
            for(DGDealDto dto:list){
                dto.setDateStr(DateUtil.getDateByFmt(dto.getDate(),"yyyy-MM-dd"));
            }
        }
    }
}
